
var myChart = echarts.init(document.getElementById("idx1"));
option = {
    title: {
        text: '双方手机的销量',
        left: 'center',
    },
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        data: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'],
        axisTick: {
          alignWithLabel: true
        }
      }
    ],
    yAxis: [
      {
        name:'销量',
        type: 'value'
      }
    ],
    label: {
        show: true,
    }, 
    series: [{
        name: '荣耀销量',
        type: 'bar',
        data: [85, 69, 71, 25, 79, 82, 80],
      },
      {
        name:'小米销量',
        data: [74, 85, 57, 68, 72, 47, 91],
        type: 'line'
      }
    ],
  };
myChart.setOption(option);

var myChart2 = echarts.init(document.getElementById("idx2"));
  var option2 = {
      grid: [
          {
              top: '15%',  bottom: '65%',
              left: '90%',  right: '80%',
          },
          {
              left: '90%', right: '80%',
              bottom: '10%',   top: '65%',
          },
        ],
      xAxis: [{gridIndex: 0,        type: 'category',
      data: ['周一','周二','周三','周四','周五','周六','周日'],
      name: '日期',},
        {gridIndex: 1, type: 'category',
        data: ['周一','周二','周三','周四','周五','周六','周日'],
        name: '日期',},
    ],
      yAxis: [{ gridIndex: 0,},
        {gridIndex: 1,},
    ],
        legend: {
            top:'left',
         },
        series: [{
            type:'line',
            data:[85,71,74,89,47,91,78],
            label: {
                show: true,
            },
            name:'荣耀销量',
            xAxisIndex:0,
            yAxisIndex:0,
          },{
             type:'line',
             data:[72,47,57,78,74,85,57],
             label: {
                 show: true,
             },
             name:'小米销量',
             xAxisIndex:0,
             yAxisIndex:0,
           },{
             type:'bar',
             data:[85,71,74,89,47,91,78],
             label: {
                 show: true,
             },
             name:'荣耀销量',
             xAxisIndex:1,
             yAxisIndex:1,
           },{
             type:'bar',
             data:[72,47,57,78,74,85,57],
             label: {
                 show: true,
             },
             name:'小米销量',
             xAxisIndex:1,
             yAxisIndex:1,
           },],
};

myChart2.setOption(option2);

var myChart3 = echarts.init(document.getElementById("idx3"));
  var option3 = {
      grid: [
          {
              top: '15%',  bottom: '65%',
              left: '90%',  right: '80%',
          },
          {
              left: '90%', right: '80%',
              bottom: '10%',   top: '65%',
          },
        ],
      xAxis: [{gridIndex: 0,        type: 'category',
      data: ['周一','周二','周三','周四','周五','周六','周日'],
      name: '日期',},
        {gridIndex: 1, type: 'category',
        data: ['周一','周二','周三','周四','周五','周六','周日'],
        name: '日期',},
    ],
      yAxis: [{ gridIndex: 0,},
        {gridIndex: 1,},
    ],
        legend: {
            top:'left',
         },
        series: [{
            type:'line',
            data:[85,71,74,89,47,91,78],
            label: {
                show: true,
            },
            areaStyle:{},
            name:'荣耀销量',
            xAxisIndex:0,
            yAxisIndex:0,
          },{
             type:'line',
             data:[72,47,57,78,74,85,57],
             label: {
                 show: true,
             },
             name:'小米销量',
             areaStyle:{},
             xAxisIndex:0,
             yAxisIndex:0,
           },{
             type:'bar',
             data:[85,71,74,89,47,91,78],
             label: {
                 show: true,
             },
             name:'荣耀销量',
             xAxisIndex:1,
             yAxisIndex:1,
             stack:'总量1',
           },{
             type:'bar',
             data:[72,47,57,78,74,85,57],
             label: {
                 show: true,
             },
             name:'小米销量',
             xAxisIndex:1,
             yAxisIndex:1,
             stack:'总量1',
           },],
};

myChart3.setOption(option3);

